//wheel.txt - A wheel that does a turn animation and sets a flag
// Cell 0,1 flag to set to one if turned

beginobjectscript; // door lever

variables;

short range = 4;

body;


beginstate INIT_STATE;

	if (get_memory_cell(1) != 0)
		range = get_memory_cell(1);
	break;

beginstate DEAD_STATE;

break;

beginstate START_STATE; 

break;

beginstate USE_STATE;
	if ((get_memory_cell(0) != 0) || (get_memory_cell(1) != 0)) {
		if (gf(get_memory_cell(0),get_memory_cell(1)) > 0) {
			print_str_color("Turn Wheel: It is stuck in this position.",2);
			end();
			}
		sf(get_memory_cell(0),get_memory_cell(1),1);
		}

	pc_heard_sound(18);
	run_object_animation(2,0,50);

	print_str_color("Turn Wheel: You turn the wheel.",2);
break;
